﻿using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using élénkPróbája.helpers;
using élénkPróbája.results;

namespace élénkPróbája.validators
{
    public abstract class NopPropertyValidator : ILitPropertyValidator
    {
        public IStringSource ErrorMessageSource
        {
            get { return null; }
            set { }
        }

        public virtual bool IsAsync
        {
            get { return false; }
        }

        public IStringSource ErrorCodeSource
        {
            get { return null; }
            set { }
        }
        public abstract IEnumerable<ValidationFailure> Validate(PropertyValidatorContext context);

        public virtual Task<IEnumerable<ValidationFailure>> ValidateAsync(PropertyValidatorContext context, CancellationToken cancellation)
        {
            return TaskHelpers.FromResult(Validate(context));
        }

        public virtual ICollection<Func<object, object, object>> CustomMessageFormatArguments
        {
            get { return new List<Func<object, object, object>>(); }
        }

        public virtual bool SupportsStandaloneValidation
        {
            get { return false; }
        }

        public Func<object, object> CustomStateProvider
        {
            get { return null; }
            set { }
        } 
    }
}